//
//  SHStatusRetweetView.swift
//  WeiBo001
//
//  Created by ZhiQiang Li on 16/7/31.
//  Copyright © 2016年 ZhiQiang Li. All rights reserved.
//

import UIKit

class SHStatusRetweetView: UIView {
    
    //供外界赋值
    var statusViewModel:CZStatusViewModel?{
        didSet{
              contentLabel.text = statusViewModel?.status?.retweeted_status?.text
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //设置视图
    private func setupUI(){
        backgroundColor = RandomColor()
        //1.添加控件
        addSubview(contentLabel)
        //2.添加约束
        contentLabel.snp_makeConstraints { (make) -> Void in
            make.top.leading.equalTo(10)
        }
        // 约束当前的view
        self.snp_makeConstraints { (make) -> Void in
            make.bottom.equalTo(contentLabel).offset(10)
        }
        
    }

    // 懒加载控件
    private lazy var contentLabel: UILabel = UILabel(textColor: UIColor.darkGrayColor(), textFont: 15, maxWidth: SCREENW - 20)
    // 配图
    private lazy var pictureView: SHPictureView = SHPictureView()

}
